package com.zcmob.web.admanagement.vo;

import java.io.Serializable;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class AppInfo extends BaseObject implements Serializable{

    /**
     * 
     */
    private static final long serialVersionUID = 6128975477569086439L;
    private String appname;
    private String packagename;
    private String description;
    private String downloadURL;
    private String channel;
    private String version;
    private long apk_size;
    private double downloadFee;
    private double longtimeuserFee;
    private double rateFee;
    private double forwardFee;
    private String contact;
    private double in_total;
    private double rest_total;
    private int pic_number;
    private String iconNameInAPK;
    private String iconHttpPath;
    private String status;
    private int active_time;
    private int active_type_id;
    
    // app, app_bid表中都有该字段，方便统计功能使用
    private int service_id;
    
    // 在app service_type表中都有该字段，app中为冗余字段,方便查询
    //体验时间,按照秒计算
    private int effect_running_time;
    private int max_times;
    // 按照分钟计算
    private int duration;
    
    private String category;
    
    private int ad_user_id;
    private String contact_email;
    private String contact_phone;
    private String summary;
    
    @Override
    public String toString() {
        GsonBuilder builder = new GsonBuilder(); 
        Gson gson = builder.create(); 
        return gson.toJson(this);
    }
    
    public int getService_id() {
        return service_id;
    }



    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }


    public int getAd_user_id() {
        return ad_user_id;
    }

    public void setAd_user_id(int ad_user_id) {
        this.ad_user_id = ad_user_id;
    }

    public String getContact_email() {
        return contact_email;
    }

    public void setContact_email(String contact_email) {
        this.contact_email = contact_email;
    }

    public String getContact_phone() {
        return contact_phone;
    }

    public void setContact_phone(String contact_phone) {
        this.contact_phone = contact_phone;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public void setService_id(int service_id) {
        this.service_id = service_id;
    }



    public int getPic_number() {
        return pic_number;
    }

    public void setPic_number(int pic_number) {
        this.pic_number = pic_number;
    }

    public int getEffect_running_time() {
        return effect_running_time;
    }

    public void setEffect_running_time(int effect_running_time) {
        this.effect_running_time = effect_running_time;
    }

    public int getMax_times() {
        return max_times;
    }

    public void setMax_times(int max_times) {
        this.max_times = max_times;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public double getIn_total() {
        return in_total;
    }

    public void setIn_total(double in_total) {
        this.in_total = in_total;
    }

    public double getRest_total() {
        return rest_total;
    }

    public void setRest_total(double rest_total) {
        this.rest_total = rest_total;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public long getApk_size() {
        return apk_size;
    }

    public void setApk_size(long apk_size) {
        this.apk_size = apk_size;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getAPKFileName () {
        
        if (downloadURL == null || downloadURL.length() ==0) {
            return null;
        }
        
        return downloadURL.substring(downloadURL.lastIndexOf("/") + 1);
    }
    
    /**
     * @return the downloadURL
     */
    public String getDownloadURL() {
        return downloadURL;
    }
    /**
     * @param downloadURL the downloadURL to set
     */
    public void setDownloadURL(String downloadURL) {
        this.downloadURL = downloadURL;
    }
    /**
     * @return the appName
     */
    public String getAppname() {
        return appname;
    }
    /**
     * @param appName the appName to set
     */
    public void setAppname(String appName) {
        this.appname = appName;
    }
    /**
     * @return the packagename
     */
    public String getPackagename() {
        return packagename;
    }
    /**
     * @param packagename the packagename to set
     */
    public void setPackagename(String packagename) {
        this.packagename = packagename;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
    /**
     * @return the downloadFee
     */
    public double getDownloadFee() {
        return downloadFee;
    }
    /**
     * @param downloadFee the downloadFee to set
     */
    public void setDownloadFee(double downloadFee) {
        this.downloadFee = downloadFee;
    }
    /**
     * @return the longtimeuserFee
     */
    public double getLongtimeuserFee() {
        return longtimeuserFee;
    }
    /**
     * @param longtimeuserFee the longtimeuserFee to set
     */
    public void setLongtimeuserFee(double longtimeuserFee) {
        this.longtimeuserFee = longtimeuserFee;
    }
    /**
     * @return the rateFee
     */
    public double getRateFee() {
        return rateFee;
    }
    /**
     * @param rateFee the rateFee to set
     */
    public void setRateFee(double rateFee) {
        this.rateFee = rateFee;
    }
    /**
     * @return the forwardFee
     */
    public double getForwardFee() {
        return forwardFee;
    }
    /**
     * @param forwardFee the forwardFee to set
     */
    public void setForwardFee(double forwardFee) {
        this.forwardFee = forwardFee;
    }

    public String getIconNameInAPK() {
        return iconNameInAPK;
    }

    public void setIconNameInAPK(String iconNameInAPK) {
        this.iconNameInAPK = iconNameInAPK;
    }

    public String getIconHttpPath() {
        return iconHttpPath;
    }

    public void setIconHttpPath(String iconHttpPath) {
        this.iconHttpPath = iconHttpPath;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getActive_time() {
        return active_time;
    }

    public void setActive_time(int active_time) {
        this.active_time = active_time;
    }

    public int getActive_type_id() {
        return active_type_id;
    }

    public void setActive_type_id(int active_type_id) {
        this.active_type_id = active_type_id;
    }

}
